package com.tron.dobest.xml;


import org.dom4j.Document;
import org.dom4j.io.SAXReader;

import java.io.File;
import java.util.List;

/**
 * 描述：
 *
 * @author TRON
 * @since 2020-04-14
 */
public class XpathStart {
    public static void main(String[] args) throws Exception {
        //1.创建Reader对象
        SAXReader reader = new SAXReader();
        //2.加载xml
        Document document = reader.read(new File("src/main/resources/logback-spring.xml"));
        System.out.println(document.getName());
        List list = document.selectNodes("//appender[@*]");
        System.out.println(list);
    }
}
